const lifecircle = {
  mounted() {
    // 清楚鼠标右键默认行为
    document.oncontextmenu = function() {
      return false;
    };
    document.body.addEventListener('click', e => {
      const { target } = e;
      if (
        (target &&
          target.children.length > 0 &&
          target.children[0].innerHTML.trim() === '新建') ||
        target.innerHTML.trim() === '新建'
      ) {
        console.log('点击了新建按钮');
      } else {
        this.clearAddButtons();
      }
    });
  }
};

export default lifecircle;
